import request from '@/utils/request'

export function saveArrivalVouchs(data) {
    return request({
        url: '/app/arrival/saveArrivalVouchs',
        method: 'post',
        data: data
    })
}

export function getArrivalItems(data) {
    return request({
        url: '/app/arrival/getArrivalItems',
        method: 'get',
        data: data
    })
}


export function getOpenArrivalVouchList(userName) {
    return request({
        url: '/app/arrival/getOpenArrivalVouchList?makeMan=' + userName,
        method: 'get',
    })
}

export function deleteArrivalItem(autoId) {
    return request({
        url: '/app/arrival/deleteArrivalItem?autoId=' + autoId,
        method: 'get'
    })
}

export function updateArrivalItem(autoId, quantity, warehouse) {
    return request({
        url: '/app/arrival/updateArrivalItem',
        method: 'get',
        params: {
            autoId: autoId,
            quantity: quantity,
            warehouse: warehouse
        }
    })
}

export function getArrivalDetails(id) {
    return request({
        url: '/app/arrival/getArrivalDetails?id=' + id,
        method: 'get'
    })
}

export function deleteArrivalVouch(id) {
    return request({
        url: '/app/arrival/deleteArrivalVouch?id=' + id,
        method: 'get'
    })
}

// 添加审核到货单接口
export function auditArrivalVouch(cCode, cverifier) {
    return request({
        url: '/app/arrival/auditArrivalVouch',
        method: 'get',
        params: {
            cCode: cCode,
            cverifier: cverifier
        }
    })
}